

import taichi as ti  
ti.init(arch=ti.cuda)

@ti.kernel
def kern():
    for i in range(5):
        print(i)
    print('inside')

print('before')
kern()
print('after')


ti.sync()  #数据同步化
print('after')







